//
//  RBQuickLoginButton.m
//  Budejie
//
//  Created by 华杨科技 on 2017/9/25.
//  Copyright © 2017年 饶波. All rights reserved.
//

#import "RBQuickLoginButton.h"

@implementation RBQuickLoginButton

- (void)awakeFromNib {
    [super awakeFromNib];
    
    NSLog(@"xibView 调用");
//    self.backgroundColor = [UIColor grayColor];
//    self.imageView.backgroundColor = [UIColor redColor];
//    self.titleLabel.backgroundColor = [UIColor brownColor];
    
    self.titleLabel.textAlignment = NSTextAlignmentCenter;
}

- (void)layoutSubviews {
    [super layoutSubviews];
    
    CGRect frame = self.frame;
    CGFloat w = frame.size.width;
    CGFloat h = frame.size.width;
    
    CGFloat imgCenterX = (w - h*0.5) * 0.5;    
    CGFloat imgW = h * 0.5;
    self.imageView.frame = CGRectMake(imgCenterX, 0, imgW, imgW);
    self.titleLabel.frame = CGRectMake(0, h * 0.5, w, imgW * 0.5);
}

@end
